package com.shao.demo.feignconsumer.common;

import com.shao.demo.feignconsumer.common.constans.StatusCode;

/**
 * @author zhiqi.shao
 * @Date 2018/5/24 8:53
 */

public class BaseRuntimeException extends RuntimeException {
    private final int code;

    public BaseRuntimeException(StatusCode statusCode) {
        this(statusCode.getStatusCode(), statusCode.getStatusMessage());
    }

    public BaseRuntimeException(int code, String message) {
        super(message);
        this.code = code;
    }

    public int getCode() {
        return this.code;
    }
}
